package com.ruoyi.wechat.util;

import javax.servlet.http.HttpServletRequest;

public class RequestUtil {

	public static String  getPortByReq(HttpServletRequest request){
		String result="";
		int locport=request.getServerPort();
		if(locport!=80&&locport!=443){
			result=":"+locport;
		} 
		return result;
	}
	public static String getScheme(HttpServletRequest request){
		//https有时不能正确获取
		//request.getScheme()
		int locport=request.getServerPort();
		if(locport==443){
			return "https";
		}
		return "http";
	}
}
